export default function () {
  const development = process.env.NODE_ENV === 'development'
  if (development) {
    return 'ws://192.168.3.99:8083'
  } else {
    const hostname = window.location.hostname
    const config = [
      { hostname: 'waimai.jiaowawang.cn', path: 'ws://waimai.jiaowawang.cn:9999' }, // 大神猫
      { hostname: '192.168.3.88', path: 'ws://waimai.jiaowawang.cn:9999' }, // 测试环境
    ]
    const index = config.findIndex(i => i.hostname === hostname)
    if (index > -1) return config[index].path
    else {
      alert('该域名未配置websocke访问路径,调度台无法自动更新订单！请联系管理员更新配置')
      return ''
    }
  }
}